﻿namespace OS.Http.Models
{
    /// <summary>
    /// 表单参数
    /// </summary>
    public struct FormParameter
    {
        /// <summary>
        /// 参数名称
        /// </summary>
        public string Name;

        /// <summary>
        /// 参数值
        /// </summary>
        public object Value;

        /// <summary>
        /// 构造函数
        /// </summary>
        /// <param name="name">参数名称</param>
        /// <param name="value">参数值</param>
        public FormParameter(string name, string value)
        {
            Name = name;
            Value = value;
        }

        /// <summary>
        /// 重写ToString返回，name=value编码后的格式
        /// </summary>
        /// <returns></returns>
        public override string ToString()
        {
            return string.Format("{0}={1}", Name, Value);
        }
    }
}